home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / HIERSV.PAK / SVRVIEW.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  4KB  |  140 lines

  1. // svrview.h : interface of the CServerView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "svritem.h"
  14.  
  15. class CServerView : public CScrollView
  16. {
  17. protected: // create from serialization only
  18.     CServerView();
  19.     DECLARE_DYNCREATE(CServerView)
  20.  
  21. // Attributes
  22. public:
  23.     CServerDoc* GetDocument()
  24.     {
  25.         ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CServerDoc)));
  26.         ASSERT_VALID(m_pDocument);
  27.         return (CServerDoc*)m_pDocument;
  28.     }
  29.     void SetSelection(CServerNode* pNewSel, CDC* pDC);
  30.     void SetSelection(CServerNode* pNewSel);
  31.  
  32. // Operations
  33. public:
  34.     void SetScrollInfo();
  35.     BOOL SetZoomFactor(CSize zoomNum, CSize zoomDenom);
  36.     void UpdateServerView();
  37.     CSize CalcActualViewSize(CDC *pDC);
  38.     CSize CalcActualItemSize(CServerNode* pItem, CDC *pDC);
  39.     CSize CalcScaledViewSize();
  40.     CSize CalcScaledItemSize(CServerNode* pItem);
  41.     BOOL DoPasteItem(COleDataObject* pDataObject);
  42.     void DoPasteNative(COleDataObject* pDataObject);
  43.     void DoPasteText(COleDataObject* pDataObject);
  44.     void DoImportText(CArchive &ar);
  45.     void ScrollToItem(CServerNode* pItem, BOOL bScrollUp);
  46.     void Locate(int cnt, BOOL bScrollUp);
  47.     void InvalidateItem(CServerNode* pItem, CDC* pDC);
  48.     void InvalidateItem(CServerNode* pItem);
  49.     void ToggleSelectedItem();
  50.  
  51. // Implementation
  52. public:
  53.     virtual ~CServerView();
  54.     virtual void OnDraw(CDC* pDC);
  55.     virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  56.     virtual void OnInitialUpdate();
  57.     virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL);
  58. #ifdef _DEBUG
  59.     virtual void AssertValid() const;
  60.     virtual void Dump(CDumpContext& dc) const;
  61. #endif
  62.  
  63.  
  64. protected:
  65.     // drag/drop stuff
  66.     COleDropTarget m_dropTarget;
  67.     DROPEFFECT m_prevDropEffect;
  68.  
  69.     // current selection - store the node and the last drawn rect
  70.     CServerNode* m_pSelectedNode;
  71.     static CServerNode* NEAR m_pDragNode;
  72.  
  73.     // upper left of drawing
  74.     CPoint m_ptStart;
  75.  
  76.     // zoom factor
  77.     CSize m_zoomNum;
  78.     CSize m_zoomDenom;
  79.  
  80.     // implementation helpers
  81.     void SelectAtPoint(CPoint point, CPoint& pointHit);
  82.     void DoBranch(CServerNode *pItem, BOOL bHide);
  83.  
  84.     virtual BOOL OnDrop(COleDataObject* pDataObject,
  85.         DROPEFFECT dropEffect, CPoint point);
  86.     virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject,
  87.         DWORD grfKeyState, CPoint point);
  88.     virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject,
  89.         DWORD grfKeyState, CPoint point);
  90.     virtual void OnDragLeave();
  91.  
  92. // Generated message map functions
  93. protected:
  94.     //{{AFX_MSG(CServerView)
  95.     afx_msg void OnChangeName();
  96.     afx_msg void OnAddNode();
  97.     afx_msg void OnUpdateHasSel(CCmdUI* pCmdUI);
  98.     afx_msg void OnEditCopy();
  99.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  100.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  101.     afx_msg void OnImportText();
  102.     afx_msg void OnViewZoomCustom();
  103.     afx_msg void OnEditCut();
  104.     afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
  105.     afx_msg void OnEditPaste();
  106.     afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  107.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  108.     afx_msg void OnEditClear();
  109.     afx_msg void OnTreeCollapsebranch();
  110.     afx_msg void OnTreeExpandall();
  111.     afx_msg void OnTreeExpandbranch();
  112.     afx_msg void OnTreeExpandonelevel();
  113.     afx_msg void OnUpdateTreeCollapsebranch(CCmdUI* pCmdUI);
  114.     afx_msg void OnUpdateTreeExpandonelevel(CCmdUI* pCmdUI);
  115.     afx_msg void OnUpdateTreeExpandall(CCmdUI* pCmdUI);
  116.     afx_msg void OnUpdateTreeExpandbranch(CCmdUI* pCmdUI);
  117.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  118.     afx_msg void OnSize(UINT nType, int cx, int cy);
  119.     //}}AFX_MSG
  120.  
  121.     // special message handling
  122.     afx_msg void OnZoom(UINT nID);
  123.     afx_msg void OnUpdateZoom(CCmdUI* pCmdUI);
  124.  
  125.     DECLARE_MESSAGE_MAP()
  126.     friend class CServerViewDC;
  127. };
  128.  
  129. class CServerDC : public CClientDC
  130. {
  131.     CFont font;
  132.     CFont *pOldFont;
  133.  
  134. public:
  135.     CServerDC(CServerView *pView);
  136.     ~CServerDC();
  137. };
  138.  
  139. /////////////////////////////////////////////////////////////////////////////
  140.